<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../css/reset.css"/>
		<link rel="stylesheet" type="text/css" href="../css/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="../css/alreadyfocus.css"/>
	    <script type="text/javascript" src="../js/jquery-2.0.3.js"></script>
	    <script type="text/javascript" src="../js/rem.js"> </script>
		<script type="text/javascript">
			$(window).load(function() {
				$('#box').delay(200).show()
			})
		</script>
	</head>
	<body>
		<!--页面加载 开始-->
		 <!-- <div id="preloader">
		    <div id="status">
		      <p class="center-text"><span>拼命加载中···</span></p>
		    </div>
		  </div>-->
		  <!--页面加载 结束--> 
		<div id="box">
	  	<!--头部-->
			<header class="focus-top">
				<i onclick="goBack()" class="iconfont">&#xe621;</i>
				<img src="../img/images/title_03.png"/>
				<i class="iconfont alreadyfocus-focus">&#xe63e;</i>
			</header>
			<!--内容区-->
			<section class="focus-cont">
				<!--<div class="focus-cont-top">
						<img src="../img/images/circle_07.jpg"/>
						<p>斗鱼TV</p>
						<p>全民直播平台</p>
						<p>已关注</p>
				</div>-->
				<!--<div class="focus-content">
				 	<img src="../img/ban.jpg"/>
				 	<p>VP战队重回世界之巅全程回顾</p>
				 	<p>Dotaer | DOTA2 /03'09"</p>
				</div>-->
				<!--<div class="focus-content-foot">无更多人内容</div>-->
			</section>
	  </div>
	<body>
	</body>
	<script type="text/javascript" src="../js/reset.js"></script>
	<script type="text/javascript" src="../js/iscroll.js"></script>
	<script type="text/javascript">
		$('.alreadyfocus-focus').on('click',function(){
			window.location.href="share.html"
		})
	     /*频道加载*/
	    var b=localStorage.getItem("user_id")
	    var channelid=localStorage.getItem("channel_id")
           $.ajax({
            type: 'POST',
            url: 'http://192.168.199.114:8080/HJF/user/get_channel_video_list.do',
            dataType: 'JSON',
            data:{user_id:b,channel_id:channelid},
            success: function(data){
            	console.log(data)
            	if(data.data.video_list[0].channel_is_followed==0){
            		var oDiv=$('<div class="focus-cont-top">'+
						'<img src="'+data.data.video_list[0].channel_head_img_url+'"/>'+
						'<p>'+data.data.video_list[0].channel_name+'</p>'+
						'<p>'+data.data.video_list[0].channel_summary+'</p>'+
						'<p>未关注</p>'+
				'</div>')
            	}else{
            		var oDiv=$('<div class="focus-cont-top">'+
						'<img src="'+data.data.video_list[0].channel_head_img_url+'"/>'+
						'<p>'+data.data.video_list[0].channel_name+'</p>'+
						'<p>'+data.data.video_list[0].channel_summary+'</p>'+
						'<p>已关注</p>'+
				'</div>')
            	}
            	$('.focus-cont').append(oDiv)
            	$.each(data.data.video_list,function(index){
            		var oDiv2=$('<div class="focus-content">'+
				 	'<img src="'+data.data.video_list[index].video_img_url+'"/>'+
				 	'<p>'+data.data.video_list[index].video_title+'</p>'+
				 	'<p>'+data.data.video_list[index].channel_name+' | ' +data.data.video_list[index].video_label_name+' / '+data.data.video_list[index].video_time+'</p>'+
				'</div>')
            		$('.focus-cont').append(oDiv2)
            		oDiv2.on('click',function(){
            			var _this=$(this).index()-1
            			window.location.href="detail.html"
            			localStorage.setItem('video_id',data.data.video_list[_this].video_id)
            		})
            	})
            	var oDiv3=$('<div class="focus-content-foot">无更多人内容</div>')
            	$('.focus-cont').append(oDiv3)
              },
	            error: function(xhr, type){
	                alert('Ajax error!');
	            }
	        });		    
	</script>
</html>
